<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习1</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <button @click="add1">{{button.name1}}</button>
    <button @click="add2">{{button.name2}}</button>
    <h4>你的按钮被点了{{count}}次</h4>
</div>
<script src="vue.js"></script>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            message: "演示Vue事件绑定操作",
            button: {
                name1: "点击+1",
                name2: "点击+2"
            },
            count: 0
        },
        methods: {
            add1() {
                this.count++;
            },
            add2() {
                this.count += 2;
            }
        }
    })
</script>
</body>
</html>